@Component
@RabbitListener(queues = RabbitConfig.MAIL_QUEUE)
public class MailListener {
    private final EmailService emailService;
    // ...
    @RabbitHandler
    public void processMessage(Map<String, String> map) {
        // ...
        emailService.sendConfirmation(username, to, code);
    }
}
